package com.meilai.project.controller.web.system;

import com.meilai.project.dto.CommonResult;
import com.meilai.project.service.system.RouterService;
import com.meilai.project.util.ThreadLocalUserUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 张驰
 * @date 2020/9/11 14:20
 */
@Api(value = "Web端路由控制器", description = "Web端路由")
@RestController
@RequestMapping("api/web/router")
public class WebRouterController {

    @Autowired
    private RouterService routerService;

    @GetMapping("list")
    @ApiOperation(value = "查询用户路由")
    public CommonResult getRouter(){
        return new CommonResult().success(routerService.getRoutersByUserId(ThreadLocalUserUtil.get().getId()));
    }
}
